Brain Worms
There are two popular video games that feature uninvited guests taking over the main characters' brains: Baldur's Gate III and Cyberpunk 2077. One of them is more akin to a parasite, while the other is a chip containing the consciousness of a long-dead human. In both instances, the guest threatens to seize control of the host's brain unless it is removed, yet directly removing the guest would simply kill the host.
Obviously, the guest works as a story device because both games are excellent in that department But why is it so effective?
I think it's simply a good way to immediately create conflict in a story. Thinking about it now, lots of stories are about characters fighting with their own selves. Having the object of the main character's battle be literally within their own mind gives the writer an easy way to express how that character changes by the end of the story. Once that object is removed, everything can go back to normal, and the character got a journey out of it that imparted a lesson.
The entire story arc of both games revolves around desperately trying to find a way to remove the parasite/digital ghost. It's the driving force of why V stays in Night City; it's the only place where someone might be able to help him remove the chip in his head. It's the only reason why you and your party travel across the Sword Coast in BG3; you're on a path to uproot the evil forces at work because it happens to be the path that will lead to your own, and your newfound friends', survival.
If you had a brain worm in your head, or any kind of parasite, I'm sure you would stop at nothing to get it out of you. Luckily in this day and age, we have doctors, and some of us have health insurance. We don't need to go on grand adventures to find a cure to those sorts of problems; unless it is some kind of rare creature that has infested our bodies, in which case we might have to go to a specialized doctor. Hopefully health insurance is free or cheap in that case, but I digress.
Put simply, I believe the story device of a parasite or object unwillingly placed in a character's body is more or less a metaphor for an internal struggle; a quest to expel that which is evil from one's own body to transform into something new, something that was suppressed by the hostile world surrounding the character(s). It is a fight for survival that is relatable in even our day and age of medical breakthroughs; although, we are all very much still fighting for the survival of our own minds.